﻿/**
 * 本质上就是判断完全平方数
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using llt = long long;

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofkase = 1;
    const array<string, 3> t {"ABC", "CAB", "BCA"};
    cin >> nofkase;
    while(nofkase--){
        int n; cin >> n;
        vector<llt> a(n);
        for(auto & i : a) cin >> i;
        llt tmp = accumulate(a.begin(), a.end(), 0ll);
        llt t = sqrt(tmp);
        cout << (t * t == tmp ? "YES\n" : "NO\n");
    }
    return 0;
}